home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / utils2 / pwrbat22.zip / DISKINFO.PWR < prev    next >
Text File  |  1994-05-18  |  4KB  |  95 lines

  1.   Variable    CurrClr,3
  2.   Variable    Normal,1,1
  3.   Variable    Off,1,2
  4.   Variable    Work,255
  5.   Variable    YLoc,2,3
  6.   Variable    HLine,80,'├──────────────────────────────────────────────────────────────────────────────┤'
  7.   Variable    Drives,26,'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  8.   Variable    OneDrive,25,'ACDEFGHIJKLMNOPQRSTUVWXYZ'
  9.   Variable    DriveCtr,2,1
  10.   Variable    TwoDrives,1,1
  11.   Variable    CurrDrive,1
  12.   Variable    CurrDir,80
  13.   Variable    VolID,12
  14.   Variable    DriveType,12
  15.   Variable    TotSpace,12
  16.   Variable    FreeSpace,12
  17.   Variable    PctFull,12
  18.   Variable    RtnCode,2
  19.   Variable    DayOfWeek,9
  20.   Variable    Month,2
  21.   Variable    Day,2
  22.   Variable    Year,4
  23.   Variable    CurrTime,11
  24.   Variable    Secs,2,0
  25.   Variable    Ind,1
  26.  
  27.   ?Color      Work,Work,CurrClr                 ;save the curr color
  28.   Cursor      Off                               ;turn off the cursor
  29.   Clear       112,,,1
  30.   Box1        1,1,80,25,116                     ;draw our main box
  31.   ?Time       CurrTime
  32.   WriteAt     65,1,CurrTime
  33.   ?Date       DayOfWeek,Month,Day,Year
  34.   Concat      Work,' ',DayOfWeek,' ',Month,'/',Day
  35.   Concat      Work,'/'
  36.   Concat      Work,Year
  37.   WriteAt     2,1,Work
  38.   Center      ' Disk Drive Status ',1           ;messages
  39.   Center      ' Press Any Key ',25
  40.   Box4        9,10,73,12,30,,8                 ;question box
  41.   WriteAt     10,11,'Does Your System Contain More Than 1 Floppy Drive ? (Y/N)',30
  42.   ReadYN      '',Work,10
  43.   ClearBox    1,1,80,25,116                     ;clear question box
  44.   WriteAt     2,2,'Drive   Volume ID   DriveType    TotalSpace   FreeSpace   % Full'
  45.   Compare     Work,'Y',,,DriveLoop
  46.   SetVar      Drives,OneDrive                   ;adjust drive letters
  47.  
  48. Label     DriveLoop
  49.   ?Time       CurrTime                          ;update our time
  50.   WriteAt     65,1,CurrTime                     ; on screen
  51.   MidString   CurrDrive,Drives,DriveCtr,1       ;get our curr drive
  52.   ?DriveExist CurrDrive,,NextDrive              ;does it exist
  53.   ?DiskInfo   CurrDrive,VolID,DriveType         ;get disk info
  54.   ?DiskSpace  CurrDrive,TotSpace,FreeSpace      ;get space info
  55.   SetVar      PctFull,TotSpace                  ;calc
  56.   Subtract    PctFull,FreeSpace                 ;     our
  57.   Divide      PctFull,TotSpace,RtnCode,2        ;         percent
  58.   Compare     RtnCode,0,MathErr                 ;                 full
  59.   Multiply    PctFull,100,RtnCode               ;make percent
  60.   Compare     RtnCode,0,,,NoErr
  61. Label     MathErr
  62.   SetVar      PctFull,'??'
  63. Label     NoErr
  64.   ?CurrDir    CurrDrive,CurrDir                 ;find curr directory
  65.   WriteAt     1,YLoc,HLine,116                  ;write a horiz line
  66.   Add         YLoc,1
  67.   WriteAt     4,YLoc,CurrDrive,126
  68.   WriteAt     8,YLoc,VolID,126
  69.   WriteAt     21,YLoc,DriveType,126
  70.   WriteAt     35,YLoc,TotSpace,126
  71.   WriteAt     48,YLoc,FreeSpace,126
  72.   WriteAt     62,YLoc,PctFull,126
  73.   Add         YLoc,1
  74.   WriteAt     2,YLoc,'Curr Dir:'
  75.   WriteAt     11,YLoc,CurrDir,126
  76.   Add         YLoc,1
  77.  
  78. Label     NextDrive
  79.   Compare     YLoc,22,EndPgm,,EndPgm            ;any more room
  80.   Compare     CurrDrive,'Z',EndPgm,,EndPgm      ;any more drives
  81.   Add         DriveCtr,1                        ;get next drive
  82.   GoTo        DriveLoop
  83.  
  84. Label     EndPgm
  85.   ?Time       CurrTime                          ;get curr time
  86.   WriteAt     65,1,CurrTime                     ;put to screen
  87.   Add         Secs,1
  88.   Compare     Secs,30,Quit                      ;do we give up
  89.   ReadKey     Work,Ind,1                        ;get a key, timeout each sec
  90.   Compare     Work,'',,EndPgm,EndPgm            ;did we timeout
  91. Label     Quit
  92.   Cursor      Normal
  93.   Color       CurrClr
  94.   Clear       CurrClr,,,0
  95.